home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d8
/
tadex10.arc
/
EXECDOWN.SLT
< prev
next >
Wrap
Text File
|
1989-04-23
|
3KB
|
114 lines
// EXECDOWN.SLT
// Version 1.00
//
// By John Abatte
// April 22, 1989
//
// This script will handle the download procedure. Currently it's only
// set up for getting files from the "Mahoney IBM-DOS" collection. The
// one item you may want to change is the name FILELIST.DAT in the
// first line of the script. You can include a full path specification
// if you want to put the file somewhere besides your Telix directory,
// just be sure to increase the string length (the number between the
// square braces [14]) to allow for a longer string. The default is just
// to create the file in your Telix subdirectory.
str fd[14] = "filelist.dat";
str fn[20];
str fc[20] = " ";
send_name(int fl)
{
fgets(fn, 20, fl); // get a filename
if (!strcmpi(fn, fc))
{
return;
}
if (!waitfor("the BBS ->", 20))
{
tone(600, 30);
status_wind("Time out!", 8);
return;
}
strupper(fn);
status_wind(fn, 10);
delay(1);
cputs(fn); // send filename read in from file
cputs("^M");
fc = fn;
}
main()
{
int fl;
int stat;
int tm;
int t1,t2,t3,t4;
tm = timer_start(1800); // wait up to 3 minutes
t1 = track("WXG, ?=HELP) ->", 0); // Main Menu
t2 = track(",Q,G,?=HELP) ->", 0); // File Menu
t3 = track("from the BBS ->", 0);
t4 = track("OK? (YNG) ->", 0);
while (!time_up (tm))
{
terminal(); // let Telix process any chars and keys
stat = track_hit(0); // see which (if any) track was hit
if (stat == t1) // in case mail took more than 2 min
{
delay_scr(2);
cputc('f');
delay_scr(1);
cputc('a');
}
if (stat == t2) // open FILELIST.DAT for reading
{
flushbuf();
fl = fopen(fd, "r");
if (fl == 0)
{
tone(600,30);
status_wind("Error Opening File! Aborted",10);
prints("Error opening FILELIST.DAT! Aborting script!");
break;
}
cputc('d'); // send download command
while (!feof (fl)) // loop until end of file list
{
send_name(fl);
}
}
if (stat == t3)
{
delay_scr(2);
cputc('^M'); // send <CR> when no more filenames
}
if (stat == t4)
{
delay_scr(2);
cputc('g'); // GoodBye
break; // get out of loop
}
}
fclose(fl); // Close file
if (time_up(1)) // force a hangup if script times out
{
prints("Download script aborting!");
hangup();
}
timer_free(tm); // free timer channel
track_free(0); // and all track channels
capture("*CLOSE*");
}